#!/usr/bin/env/python
# -*- coding: utf-8 -*-

# @File : Ssh.py
# @Author : t_fengyun
# @Time : 2019/9/12 13:47
# @desc : there is description

import paramiko

ssh = paramiko.SSHClient()

'''允许连接不在know_hosts文件中的主机。'''
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.117.147',22,'root','12345678')

command = input('please input command >>:').strip()
stdin, stdout, stderr = ssh.exec_command(command.encode('utf-8'))
print(stdout.readlines())
ssh.close()
